package com.common.www.repository;

import org.springframework.boot.base.jpa.repository.support.ExtendedRepository;
import com.common.www.bean.entity.TestDatabase;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * Created by luozisong on 2017/8/9.
 */
@Repository
public interface TestDatabaseRepository extends ExtendedRepository<TestDatabase, Long> {
    /**
     * 根据金钱来修改状态
     */
    @Modifying
    @Query(value = "update test_database set inventory =1 where  id=?", nativeQuery = true)
    void updateStateByMoney(Long id);

}
